package com.jcl.elasticsearch.mapper;

import com.jcl.elasticsearch.mapper.provider.SearchResumeSqlProvider;
import com.jcl.elasticsearch.resume.model.SearchResume;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * @author 刘明新
 * @date 2018/8/3 上午9:56
 */
public interface SearchResumeMapper {


    @Select({
            "select * from search_resume"
    })
    List<Map<String,Object>> findAll();

    @Select({
            "select * from search_resume where id = #{id}"
    })
    Map<String,Object> findOneMap(@Param("id") Integer id);

    @Select({
            "select * from search_resume where id = #{id}"
    })
    SearchResume findOne(@Param("id") Integer id);

    @InsertProvider(type= SearchResumeSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int add(SearchResume searchResume);

    @UpdateProvider(type=SearchResumeSqlProvider.class, method="updateByPrimaryKeySelective")
    int update(SearchResume searchResume);

}
